#!/bin/bash
# Zaitan Module - ddclient Install
# Zaitan Team <http://code.google.com/p/zaitan/>

RMOD_ENGINE='2.0'
RMOD_CATEGORY='Software'
RMOD_SUBCATEGORY='Interface'
RMOD_NAME='ddclient'
RMOD_AUTHOR='Zaitan Team'
RMOD_VERSION='3.7'
RMOD_DESCRIPTION='Installs ddclient'
RMOD_UPDATE_URL='http://code.google.com/p/zaitan/'


# Install Deluge Torrent

echo Running $RMOD_NAME...
#/usr/lib/zaitan/modulo/mod-checkInstall

cd /usr/share/zaitan
wget -c http://www.dyndns.com/download/clients/unix/ddclient.tar.gz
tar -xzvf ddclient.tar.gz
cd ddclient-3*
cd ddclient
cp ddclient /usr/local/bin/
mkdir /etc/ddclient
mkdir /var/cache/ddclient

echo "# Gravar os log no syslog (/var/log/messages)
  syslog=yes  			# log update msgs to syslog
  pid=/var/run/ddclient.pid  	# record PID in file.
  #use=ip,  ip=127.0.0.1        # Para IP estático
  #use=if,  if=eth0 		# via interfaces de rede
  use=web  			# via web
  protocol=dyndns2  		# default protocol#Servidor onde o ddclient irá pegar o seu ip
  server=members.dyndns.org  	# default server
  login=jniltinho 		# default login
  password=xxxx 		# default password
  #mx=zaitan.homelinux.org  	# default MX
  #backupmx=yes|no  		# host is primary MX?
  #wildcard=yes|no   		# add wildcard CNAME?
  
  #Aqui vem o nome do servidor que você criou mais o dominio que vê escolheu.
  zaitan.homelinux.org" > | tee -a /etc/ddclient/ddclient.conf


zenity --info --text="Agora basta acresentar o ddclient no crontab para que o mesmo se encarregue de atualizar os dados.

  Execute esses comandos no Terminal:
  crontab -e
  */5 * * * * /usr/local/bin/ddclient >/dev/null 2>/dev/null


Apos isso modifique o arquivo de configuração /etc/ddclient/ddclient.conf"


echo $RMOD_NAME Finibashed...

##Logs
echo $RMOD_NAME-$RMOD_VERSION | tee -a /usr/share/zaitan/logs
/usr/lib/zaitan/modulo/mod-logs
##

exit 0

